﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ComponentModel.DataAnnotations;
using DataAnnotationsExtensions;

namespace DomainModel
{
    public class Login : EntityBase
    {
        public int LoginID { get; set; }

        public string Email { get; set; }
        public string PasswordHash { get; set; }

        [Required]
        [UserName]
        [NoHtml]
        [Display(Name = "User name")]
        [StringLength(20, ErrorMessage = "The User name field has maximum 20 characters")]
        public string UserName { get; set; }

        //[Required]
        //[Email]
        //[Display(Name = "Email")]
        //[StringLength(48, ErrorMessage = "The Email field has maximum 48 characters")]
        //public string Email { get; set; }

        //[Required]
        //[StringLength(32, MinimumLength = 6, ErrorMessage = "The Password field has minimum 6 characters and maxinum 32 characters")]
        //[DataType(DataType.Password)]
        //[Display(Name = "Password")]
        //public string Password { get; set; }
        
        public DateTime CreateDate { get; set; }
        public DateTime ModifiedDate { get; set; }
        public Boolean IsAdmin { get; set; }
        //signup, //change email, set false, new key, new create date //key only for 24 hours
        //after confirmation, set true to EmailConfirmed, set null to key and createDate
        public Boolean EmailConfirmed { get; set; }
        public string EmailConfirmationKey { get; set; }
        public DateTime EmailConfirmationKeyCreateDate { get; set; }
        //request reset, new key, new create date //key only for 24 hours
        //after reset, set null to key, set nul to create date
        public string PasswordResetKey { get; set; }
        public DateTime PasswordResetKeyCreateDate { get; set; }

        public string AccountType { get; set; }
        public int AccountID { get; set; }
    }
}
